package com.example.framework509.common.services;

import com.example.framework509.common.entities.ResMsg;

import java.util.List;
import java.util.Map;

public interface EntityBaseService<E> {

    E getEntityFromId(Integer entityId, boolean allowNull);

    E getEntityFromRedisProp(String propName, String value, boolean allowNull);

    E getEntityFromParam(Object param, boolean byId, boolean allowNull);

    E getEntityFromId(Integer entityId);

    E getEntityFromRedisProp(String propName, String value);

    E getEntityFromParam(Object param, boolean byId);

    Integer getAllEntityNum();

    List<E> getAllEntities();

    List<E> getEntitiesByPropName(String propName, Object value);

    List<E> getEntitiesByPage(Integer page, Integer pageSize);

    List<E> getEntitiesByMap(Map searchMap, boolean reverse);

    List<E> sGetEntitiesFromRedisKey(String propSetName);

    List<Object> sGetValuesFromRedisKey(String propSetName);

    ResMsg baseQueryNum();

    ResMsg baseQueryAdd(Object paramEntity);

    ResMsg baseQueryDelOneById(Integer entityId);

    ResMsg baseQueryDelOneByRedisProp(String propName, String value);

    ResMsg baseQueryDelOneByParam(Object param);

    ResMsg baseQueryEditById(Object paramEntity);

    ResMsg baseQueryEditByParam(Object paramEntity, boolean byId);

    ResMsg baseQuerySearch(Object searchParam);

    ResMsg baseQuerySearchByMap(Map searchMap, boolean reverse);

    ResMsg baseQuerySearchByMap(Map searchMap);

    ResMsg baseQuerySearchByMapReverse(Map searchMap);

    ResMsg baseQueryPageData(Integer page, Integer pageSize);

    ResMsg baseQueryPageDataReverse(Integer page, Integer pageSize);

}
